#include "mystdio.h"

  //if(fd == NULL) 
  //  return 1;
  //char arr1[100] = "myfile.c";
  //size_t num = my_fwrite(arr1,sizeof(char),strlen(arr1),fd);
  ////printf("%u",num);
  //my_fflush(fd);
  //char* arr;
  //my_fread(arr,sizeof(arr),1,fd);
  ////printf("%d,,,,, %d",sizeof(arr),strlen(arr));
  //printf("%s\n",arr);
  //my_fclose(fd);
  

int main()
{
  MyFile* fd = my_fopen("/home/zrb/107期/myFile/test.txt","w+");
  char buffer[1024];
  int cnt = 100;
  const char* str = "hello world";
  while(cnt)
  {
    snprintf(buffer,sizeof(buffer),"%s %d\n",str,cnt--);
    my_fwrite(buffer,strlen(buffer),1,fd);
    my_fflush(fd);
  }
  my_fclose(fd);
}
  

//int main()
//{
//	char str1[] = "Hello";
//	char str2[] = "bit";
//	int num = 200;
//
//	int ret1 = my_printf("第%d行 : %s %c%c%c\n", 100, "hello", 'b', 'i', 't');
//	int ret2 = my_printf("第%d行 : %s %s\n", num, str1, str2);
//
//
  //my_printf(NULL);
  //试验：当传入空指针时。
//
//	my_printf("ret1 = %d\n", ret1);
//	my_printf("ret2 = %d\n", ret2);
//
  
	//return 0;
//}



